import type { AxiosRequestConfig, AxiosResponse } from "axios";

export interface WRequestInterceptors<T = AxiosResponse> {
  // 定义拦截器对应变量
  //  加上?都是可选
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig;
  requestInterceptorCatch?: (error: any) => any;
  // responseInterceptor?: (res: AxiosResponse) => AxiosResponse;
  responseInterceptor?: (res: T) => T;
  responseInterceptorCatch?: (error: any) => any;
}

export interface WRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: WRequestInterceptors<T>;
  showLoading?: boolean;
}
